package com.wowoai.user.entity;

import com.wowoai.common.basemodule.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 用户操作记录表
 */
@Getter
@Setter
@Table(name = "score_option_log")
@Entity
public class ScoreOptionLogEntity extends BaseEntity {

    /**
     * 被操作的用户id
     */
    @Column(name = "user_id")
    private Long userId;

    @Column(name = "user_name")
    private String userName;

    @Column(name = "phone_number")
    public String phoneNumber;
    /**
     * 操作类型
     */
    @Column(name = "option_type")
    private Short optionType;

    /**
     * 操作类型名称
     */
    @Column(name = "option_type_name")
    private String optionTypeName;

    /**
     * 操作值的结果
     */
    @Column(name = "option_value")
    private String optionValue;

    public static ScoreOptionLogEntity create(Long id,Long creatorId,String creatorName){
        ScoreOptionLogEntity scoreOptionLogEntity = new ScoreOptionLogEntity();
        scoreOptionLogEntity.setId(id);
        scoreOptionLogEntity.setCreatorId(creatorId);
        scoreOptionLogEntity.setCreatorName(creatorName);
        scoreOptionLogEntity.setCreateTime(System.currentTimeMillis());
        scoreOptionLogEntity.setDeleted(Boolean.FALSE);
        return scoreOptionLogEntity;
    }
}
